package com.tdd.mockexample;

import static org.mockito.Mockito.*;

import org.junit.Test;

public class LoginServiceTest {
	@Test
	public void loginWithCorrectPasswordAndAccount() {
		Account account = mock(Account.class);
		AccountRepoisitory repository = mock(AccountRepoisitory.class);

		when(repository.findAccountNamed("account")).thenReturn(account);
		when(account.passwordMatches("password")).thenReturn(true);
		
		LoginService loginService = new LoginService();

		loginService.login("account", "password");

		// verify account's status is logged in
	}
}
